---
- name: "[{{ name }}] Create secret"
  vars:
    env_file: "{{ lookup('file', '{{ name }}/.env.j2') }}"
  community.docker.docker_secret:
    name: "{{ name }}.env"
    data: "{{ env_file | b64encode }}"
    labels:
      secret: "{{ env_file | hash('sha1') }}"
    data_is_b64: true
    state: present